Over the course of our lives, we learn to perform a wide variety of actions. From reaching for food or fighting off an enemy, many actions require exact motor control to successfully lead to a desirable outcome. Learning to perform a novel action starts with the action being behaviorally flexible, and eventually transitions to automatized execution. How are these behaviorally flexible and automatized actions generated? The neural mechanism of motor learning has not been fully elucidated, but has been posited to arise from integrating neuronal signals about motor commands, environmental context, and outcome in the striatum. The dorsal medial striatum (DMS) is important for early learning and goal-directed action, while the dorsal lateral striatum (DLS) is more important for automatization and habit formation. I hypothesize that thalamic input into the DMS mediates flexible performance of motor skills and thalamic input into the DLS maintains automatic execution of motor skills. It has been shown that plasticity of glutamatergic inputs to the striatum are critical for motor learning. Previous investigations into striatal information integration have focused on the glutamatergic cortical projections to dorsal striatum. What has been largely ignored is that the dorsal striatum does not receive glutamatergic input only from the cortex, but also from the thalamus. It has been shown that lesions of specific thalamic nuclei that project to the dorsal striatum produce deficits in goal-directed learning and reward devaluation. The two densest thalamostriatal projections come from the parafasicular nucleus (Pf) and the posterimedial nucleus (POm). Medial-Pf (mPF) projects broadly to DMS, while lateral-Pf (lPf) and POm project to DLS. This segregated projection circuitry of Pf and POm and the established roles of DMS and DLS in distinct phases of motor learning, suggest that thalamic projections to DLS and DMS may have different roles in early and late motor learning. Aim 1 will focus on building a novel head-fixed behavioral paradigm (the joystick task) in which mice learn to perform forelimb motor actions. Aim 2 will characterize the activity of thalamic inputs to DMS and DLS during flexible and automatic performance of the joystick task from Aim 1. Aim 3 will elucidate if Pf and POm are necessary for flexible and automatic performance of motor skills by optogenetically manipulating the thalamic nuclei?s activity during performance of the joystick task from Aim 1. These experiments will be the first to dissect the role of thalamostriatal projections during motor learning in behaving mice coupled with detailed population level analysis using 2-photon calcium imaging. Exploring the role of these striatal inputs will shed light on the elusive nature of the thalamus, an evolutionarily ancient structure, and its critical role in motor learning.